﻿<controls:ChildWindow x:Class="Silverlight.Navigation.Controls.SubMenu"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="300" 
           Title="SubMenu">
    <controls:ChildWindow.Resources>

        <Style x:Key="VerticalItemsControlStyle" TargetType="ItemsControl">
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Vertical"
							VerticalAlignment="Center"
							HorizontalAlignment="Center"/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <DataTemplate x:Key="SubMenuItemDataTemplate">
            <Border Background="Transparent" Margin="2,2,2,2"
                            BorderBrush="#FF000000" BorderThickness="2,2,2,2" CornerRadius="4,4,4,4">
                <Button Content="{Binding Title}" Background="Transparent" BorderBrush="Transparent" Click="Button_Click" />
            </Border>
        </DataTemplate>

    </controls:ChildWindow.Resources>
    
    <Grid x:Name="LayoutRoot" Margin="2">
        
        <ItemsControl x:Name="SubMenuItemsControl"
                      Style="{StaticResource VerticalItemsControlStyle}"
                      ItemTemplate="{StaticResource SubMenuItemDataTemplate}" />
        

    </Grid>
</controls:ChildWindow>